package com.coffee.concurrent;

import com.lmax.disruptor.ExceptionHandler;
import lombok.extern.slf4j.Slf4j;


/**
 * @Author King.Song
 * @since 2020/2/29 0029
 **/
@Slf4j
public class DisruptorExceptionHandler implements ExceptionHandler<Object> {

  @Override
  public void handleEventException(final Throwable ex, final long sequence, final Object event) {
      log.error("Exception processing: sequence "+ sequence+", event "+ event.toString(), ex);
  }

  @Override
  public void handleOnStartException(final Throwable ex) {
      log.error("Exception during onStart: ", ex);
  }

  @Override
  public void handleOnShutdownException(final Throwable ex) {
      log.error("Exception during onShutdown:", ex);
  }

}
